Learn R Programming

VeryLargeIntegers (version 0.2.1)

25. Counting 1 bits: Counting the Number of 1-Bits in vli Objects

Description

Counting the number of 1-bits in the base 2 expression of vli (Very Large Integer) objects.

Usage

count1bits(x)

# S3 method for default count1bits(x)

# S3 method for numeric count1bits(x)

# S3 method for vli count1bits(x)

Value

integer

Arguments

x

object of class vli

Author

Javier Leiva Cuadrado

Examples

Run this code
x <- as.vli("69158247560284795612")
count1bits(x)

Run the code above in your browser using DataLab